home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / A-Monthly Disks / (c)abi.d64 / car cost_mile (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  6KB  |  209 lines

  1. 2 GOSUB2000:PRINT"      CAR FINANCIAL";""
  2. 3 PRINT"THIS PROGRAM CALCULATES THE ACTUAL"
  3. 4 PRINT"COSTS OF A CAR IN COSTS PER MILE."
  4. 6 PRINT"PURCHASE AND BUYING ON TIME ARE"
  5. 7 PRINT"CONSIDERED. THE PROGRAM CONSIDERS"
  6. 8 PRINT"FINANCE CHARGES, OIL CONSUMPTION,"
  7. 9 PRINT"TIRE & GAS COSTS, MAINTENANCE COSTS,
  8. 10 [153]"PLANED USE,AND USEFUL LIFE."
  9. 14 [133]"ARE YOU READY (YES/SAMPLE INPUT=1)";V$
  10. 16 [139] V$[178]"1" [167] 1000
  11. 18 [156]
  12. 19 XX[178]1
  13. 20 [133] "LOADWHO IS THE CAR MANUFACTURER....";A$
  14. 40 [153] "LOADWHAT IS THE YEAR OF THE CAR....":[133] C$
  15. 60 [153] "LOADWHAT IS THE PURCHASE COST OF THE CAR....":[133] E
  16. 70 [153] "LOADINPUT THE ESTIMATED YEARS OF (USE,LIFE) ....":[133]  F,UL
  17. 80 [153]"LOADWHAT IS YOUR ESTIMATED COST OF GAS IN $/GALLON...":[133]G
  18. 90 [153]"LOADWHAT IS YOUR ESTIMATED COST OF OIL PER  QUART....":[133] H
  19. 100 [153]"LOADWHAT IS YOUR ESTIMATED TIRE COST PER    TIRE..":[133]I
  20. 110 [153]"LOADWHAT IS YOUR ESTIMATED NUMBER OF DRIVING MILES PER YEAR...":[133]J
  21. 120 [153]"LOADWHAT IS THE ESTIMATED TIRE LIFE IN MILES...":[133] K
  22. 130 [153]"LOADWHAT IS YOUR ESTIMATED COST OF COLLISION INSURANCE PER YEAR..."
  23. 132 [133]L
  24. 146 [133]"LOADAMOUNT TO BE FINANCED";AF:[133]"LOADYEARS OVER WHICH FINANCED";YF
  25. 147 [133]"LOADESTIMATED INT. RATE APR%....";I(2):I(2)[178]I(2)[172].01
  26. 148 [133]"LOADMPG RATING (CITY,HIWAY)...";M,N
  27. 149 [133]"LOAD% HIWAY DRIVING....";O
  28. 150 [153]"LOADTHIS TERMINATES THE INPUT PHASE OF THE "
  29. 151 [153]"PROGRAM.......HERE IS A SUMMARY!
  30. 160 Z=TI
  31. 170 IF (TI-Z)<300 THEN 170
  32. 171 PRINT"[147]";SPC(10);"INPUT PARAMETERS";""
  33. 180 PRINT "MANUFACTURER.....";A$
  34. 181 PRINT "MODEL............";B$
  35. 182 PRINT "CAR YEAR.........";C$
  36. 184 PRINT "PURCHASE PRICE...";E
  37. 185 PRINT "YEARS OF USE,LIFE";F;",";UL
  38. 186 PRINT "GAS PRICE........";G
  39. 187 PRINT "OIL PRICE........";H
  40. 188 PRINT "TIRE COST........";I
  41. 189 PRINT "TIRE LIFE........";K
  42. 190 PRINT "MILES/YEAR.......";J
  43. 191 PRINT "INSURANCE COST...";L
  44. 193 PRINT "MILAGE CITY,HIWAY...";M;",";N
  45. 194 PRINT "% HIWAY MILAGE......";O
  46. 196 PRINT "AMOUNT FINANCED..";AF
  47. 197 PRINT "YEARS FINANCED...";YF
  48. 198 PRINT "FINANCE CHARGE %.";I(2)*100
  49. 200 INPUT"ARE THE ABOVE INPUTS CORRECT-Y/N";Z$
  50. 201 IF Z$<>"Y" THEN 600
  51. 205 GOSUB 300
  52. 210 GOSUB 500
  53. 211 FC(XX)=FC:PT(XX)=PMT
  54. 212 C(1)=EP+PCH-FC:D(XX)=C(1):E(XX)=C(1)/(F*J):FC(XX)=FC
  55. 213 C(2)=EP+PCH:F(XX)=C(2):G(XX)=C(2)/(F*J)
  56. 217 GOSUB2100
  57. 218 PRINT"        [146]COST SUMMARY"
  58. 219 PRINT"";A$;" ";B$;" ";C$
  59. 220 PRINT TAB(26)"[145]$";E
  60. 222 PRINT"TOTAL COSTS(NOT FINANCED)$";INT(C(1)*100)/100
  61. 224 PRINT"COST PER MILE............$";INT((C(1)/(F*J))*1000)/1000
  62. 225 PRINT"MONTHLY PAYMENT..........$";INT(PMT*100)/100
  63. 228 PRINT"TOTAL LOAN COST..........$";INT(FC*100)/100
  64. 234 PRINT"TOTAL COSTS (FINANCED)...$";INT(C(2)*100)/100
  65. 236 PRINT"COST PER MILE............$";INT(C(2)/(F*J)*1000)/1000
  66. 238 GOSUB 700
  67. 239 PRINT:PRINT:INPUT "DO YOU WISH TO MODIFY A PARAMETER";ZZ$
  68. 240 IF ZZ$="Y"THEN XX=XX+1
  69. 241 IF ZZ$="Y"THEN GOSUB600
  70. 242 GOSUB 800
  71. 300 REM*DPN & FINANCE COSTS***
  72. 312 REM***VALUE DECREASE***
  73. 314 W=E:MM=0:DPN=0
  74. 315 FORV=FTO1STEP-1
  75. 316 MM=(W/UL)*1.5
  76. 318 DPN=DPN+MM:W=E-DPN
  77. 320 NEXTV
  78. 400 REM*****FINANCE COSTS*****
  79. 410 PV=(1-(1/(1+(I(2)/12))^(YF*12)))/(I(2)/12)
  80. 415 PMT=(1/PV)*AF:FC=(12*YF*PMT)-AF
  81. 440 PCH=DPN+FC
  82. 450 RETURN
  83. 500 REM*****EXPENDIBLES*******
  84. 512 A(1)=J*(O/100)*(1/M)*G:REM**$/YR CITY GAS
  85. 514 A(2)=J*((100-O)/100)*G/N:REM**HWY GAS
  86. 516 QQ(1)=(1+.01)^F
  87. 518 GAS=(A(1)+A(2))*QQ(1)*F
  88. 522 OIL=(8*J/6000)*H*(1+.01)^F*F
  89. 532 TYR=(J/K)*F*I*4-4*I
  90. 542 PTS=35*12*(1+.10)^F*F
  91. 552 INS=L*F
  92. 562 EP=GAS+OIL+PTS+INS+TYR
  93. 565 RETURN
  94. 600 REM"***MODIFY PERAMETERS**"
  95. 608 PRINT"[147]      PARAMETERS"
  96. 609 PRINT
  97. 610 PRINT "MANUFACTURER.....";A$
  98. 612 PRINT "MODEL............";B$
  99. 614 PRINT "CAR YEAR.........";C$
  100. 618 PRINT "(E)PURCHASE PRICE...";E
  101. 620 PRINT "(F)YEARS OF USE,LIFE";F;UL
  102. 622 PRINT "(G)GAS PRICE........";G
  103. 624 PRINT "(H)OIL PRICE........";H
  104. 626 PRINT "(I)TIRE COST........";I
  105. 628 PRINT "(K)TIRE LIFE........";K
  106. 630 PRINT "(J)MILES/YEAR.......";J
  107. 632 PRINT "(L)INSURANCE COST...";L
  108. 633 PRINT"(M)CITY/HIWAY MILAGE......";M;",";N
  109. 634 PRINT "(O)% HIWAY MILAGE.....";O
  110. 636 PRINT"I(2) % LOAN INTEREST RATE.....";I(2)*100
  111. 637 PRINT "(AF)AMOUNT FINANCED...";AF
  112. 638 PRINT "(YF)YEARS  FINANCED...";YF
  113. 639 PRINT:IFQ=1THEN 666
  114. 640 INPUT"WHAT PARAMETER IS TO BE CHANGED-(LETTER,VALUE)";AA$,BB
  115. 641 IF AA$="E" THEN E=BB
  116. 642 IF AA$="F" THEN F=BB
  117. 643 IF AA$="F" THEN GOSUB 690
  118. 644 IF AA$="G" THEN G=BB
  119. 645 IF AA$="H" THEN H=BB
  120. 646 IF AA$="I" THEN I=BB
  121. 647 IF AA$="K" THEN K=BB
  122. 648 IF AA$="J" THEN J=BB
  123. 649 IF AA$="L" THEN L=BB
  124. 650 IF AA$="O" THEN O=BB
  125. 651 IF AA$="M" THEN M=BB
  126. 652 IF AA$="M" THEN GOSUB 680
  127. 653 IF AA$="I(2)" THEN I(2)=BB*.01
  128. 654 IF AA$="AF" THEN AF=BB
  129. 655 IF AA$="YF" THEN YF=BB
  130. 659 IFQ=1THENQ=0:IFQQ=1THEN666
  131. 660 GOSUB3000
  132. 661 INPUT"[145][145][145]DO YOU WANT TO CHANGE SOMETHING ELSE? (Y/N)";ZX$:GOSUB3000
  133. 662 IF ZX$<>"Y"THEN 665
  134. 663 INPUT"[145][145][145]WHAT PARAMETER IS TO BE CHANGED-(LETTER,VALUE)";AA$,BB
  135. 664 GOTO641
  136. 665 Q=1:GOTO600
  137. 666 INPUT"OK (Y/N)";Q$
  138. 667 QQ=0
  139. 668 IFQ$="Y"THEN PRINT
  140. 669 IFQ$="Y"THEN 205
  141. 670 IF Q$<>"Y"THEN 660
  142. 671 RETURN
  143. 680 INPUT"[145]HIWAY MPG";N
  144. 681 RETURN
  145. 690 INPUT"[145]USEFUL LIFE";UL
  146. 691 RETURN
  147. 700 REM****EXPENDABLES DETAIL****
  148. 702 PRINT"EXPENDIBLES....";EP:PRINTTAB(33)"[145]"INT(100*(EP/C(2)));"%"
  149. 704 PRINT"GAS............";GAS:PRINTTAB(29)"[145]"INT(100*(GAS/C(2)));"%"
  150. 706 PRINT"OIL............";OIL:PRINTTAB(29)"[145]"INT(100*(OIL/C(2)));"%"
  151. 708 PRINT"TIRES..........";TYR:PRINTTAB(29)"[145]"INT(100*(TYR/C(2)));"%"
  152. 710 PRINT"PARTS..........";PTS:PRINTTAB(29)"[145]"INT(100*(PTS/C(2)));"%"
  153. 712 PRINT"INSURANCE......";INS:PRINTTAB(29)"[145]"INT(100*(INS/C(2)));"%"
  154. 715 IF I(2)=0 THEN 720
  155. 716 PRINT:PRINT"FINANCE CHARGE ";FC:PRINTTAB(33)"[145]"INT(100*(FC/C(2)));"%"
  156. 717 PRINT"DEPRECIATION   ";DPN:PRINTTAB(33)"[145]"INT(100*(DPN/C(2)));"%"
  157. 720 RETURN
  158. 800 REM*****ARRAY FOR ALTERNATIVES*****
  159. 810 INPUT"[147]DO YOU WANT A SUMMARY OF THE  ALTERNATIVES YOU EXAMINED";AA$
  160. 812 IF AA$="N" THEN 900
  161. 813 PRINT"[147]";"SUMMARY OF ALTERNATIVES[146]"
  162. 814 PRINT"ALT","TOTALCOST","           COST/MILE"
  163. 816 FOR AAA=1 TO XX
  164. 817 PRINTAAA,INT(F(AAA)*100)/100:PRINT TAB(30)"[145]"INT(G(AAA)*1000)/1000
  165. 818 NEXT AAA
  166. 819 PRINT""
  167. 820 PRINT"ALT"," MO PMT  ","           FINC CHG "
  168. 821 FOR AAA=1 TO XX
  169. 822 PRINTAAA,INT(PT(AAA)*100)/100:PRINTTAB(30)"[145]"INT(FC(AAA)*100)/100
  170. 823 NEXT AAA
  171. 824 PRINT""
  172. 826 PRINT"THE USEFULNESS OF THE ABOVE DEPENDS ON"
  173. 827 PRINT"KNOWING THE PARAMETERS YOU ALTERED!!"
  174. 900 END
  175. 1000 A$="CHEVORLET"
  176. 1001 B$="CAMERO"
  177. 1002 C$="1978"
  178. 1004 E=5865
  179. 1005 F=5:UL=10
  180. 1006 G=.63
  181. 1007 H=.78
  182. 1008 I=35.00
  183. 1009 K=30000
  184. 1010 J=15000
  185. 1011 L=220
  186. 1012 M=25
  187. 1013 N=29
  188. 1014 O=63
  189. 1016 XX=1
  190. 1017 I(2)=.1106:YF=3:AF=4200
  191. 1020 GOTO 150
  192. 2000 REM***BOARDER 1***
  193. 2001 PRINT"[147]"
  194. 2002 T$="[185]":U$="[181]":V$="[182]":S$="[184]"
  195. 2004 FOR V=1 TO 39:PRINTT$;:NEXT V:PRINT"[157]
  196. 2006 [129] V[178]1 [164] 15:[153]U$;[166]37)V$:[130] V:[153]"CMD
  197. 2008 FOR V=1 TO 39:PRINTS$;:NEXTV:PRINT"[157]
  198. 2010 [142]
  199. 2100 [143]*****BOARDER 2******
  200. 2101 [153]"LOAD"
  201. 2102 T$[178]"POS":U$[178]"INT":V$[178]"ABS":S$[178]"FRE"
  202. 2104 [129] V[178]1 [164] 39:[153]T$;:[130] V:[153]"CMD
  203. 2106 FOR V=1 TO 22:PRINTU$;SPC(37)V$:NEXT V:PRINT"[157]
  204. 2108 [129] V[178]1 [164] 39:[153]S$;:[130]V:[153]"CMD
  205. 2110 RETURN
  206. 3000 PRINT"[145][145]                                        "
  207. 3001 PRINT"[145]                                        "
  208. 3002 RETURN
  209.